﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 第二次课堂作业
{
    public partial class Form2 : Form
    {

        public Form2()
        {
            InitializeComponent();
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            int low = int.Parse(textBox1.Text);
            int high = int.Parse(textBox2.Text);
            int i, j,k;
            string text3 = "";

            for(i = low;i <= high;i++)
            {
                k = 0;
                for(j = 2;j < i;j++)
                {
                    if (i % j == 0)
                        k++;
                }
                if (k == 0)
                    text3 = text3 + i + " ";
            }

            textBox3.Text = text3;
        }
    }
}
